
// THIS IS JUST PRACTICAL FOR BUILDING JINCBASETYPE.XSD
// ACTUALLY NOT PART OF THE SOURCE CODE !!!

/* <?xml version="1.0"?> */
/* <schema  */
/* targetNamespace="http://www.jinc.com/jincSchema"  */
/* xmlns="http://www.w3.org/2001/XMLSchema" */
/* xmlns="http://www.jinc.com/jincSchema" */
/* elementFormDefault="unqualified"	 */
/* attributeFormDefault="unqualified"> */

#include "jincPrTypes.h"
#include "jncDefs.h"
#include <boost/preprocessor/seq/subseq.hpp>
#include <boost/preprocessor/repetition/enum.hpp>

#define CHR          1
#define SHT          5
#define INT          10
#define LNG          10
#define DBL          20


#define SPECTYPE(type, expr)			\
  <simpleType name=type>;			\
  %<restriction base="string">;			\
  %%<pattern value=expr>;			\
  %</restriction>;				\
  </simpleType>;;

#define SPECELEM(elem)				\
  <element name=elem>;				\
  %<complexType>;				\
  %%<complexContent>;				\
  %%%<restriction base=anyType>;		\
  %%%%<attribute name="val" type=elem/>;	\
  %%%</restriction>;				\
  %%</complexContent>;				\
  %</complexType>;				\
  </element>;;
  

#define BASETYPE(r, data, t)			\
  BOOST_PP_EXPR_IF(BOOST_PP_SUB(BOOST_PP_SEQ_SIZE(t), 1), (BOOST_PP_SEQ_HEAD(t)))

#define SEQBASETYPE				\
  BOOST_PP_SEQ_FOR_EACH(BASETYPE, ~, LOCAL)

#define XMLTYPE(z, n, data)			\
  SPECTYPE(BOOST_PP_SEQ_ELEM(0, BOOST_PP_SEQ_ELEM(n, LOCAL)), BOOST_PP_SEQ_ELEM(n, REGEXP))

#define XMLELEM(r, data, t)			\
  SPECELEM(t)


BOOST_PP_REPEAT(BOOST_PP_SEQ_SIZE(REGEXP), XMLTYPE, ~)
  BOOST_PP_SEQ_FOR_EACH(XMLELEM, ~, SEQBASETYPE)

#define PUTC(z, n, data)  (BOOST_PP_CAT(C, data)%)
     BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_FOR_EACH(PUTC, ~, SEQBASETYPE))
/* </schema> */
